<?php

Raise::load('core.io.file.RaiseFileSystem');

/**
 * TestCoreRaiseFileSystem class
 * Testing unit of 'phpraise/core/RaiseFileSystem.php'
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package Raise.UnitTest.Test
 */
class TestCoreRaiseFileSystem extends RaiseTest {
    
    public static function testClass(){
        self::assertClassExists('RaiseFileSystem');
        self::assertClassExtends('RaiseFileSystem', 'RaiseStaticClass');
    }

    public static function testFileExist(){
        self::assertTrue(RaiseFileSystem::fileExist('mocks/MockConfigFile.ini'));
        self::assertTrue(RaiseFileSystem::fileExist('index.php'));
        self::assertFalse(RaiseFileSystem::fileExist('path_to/Nowhere'));
        self::assertFalse(RaiseFileSystem::fileExist('path_test\Nowhere.bin'));
    }

    public static function testDiskSpace(){
        self::assertType(RaiseFileSystem::diskFreeSpace('/'), 'double');
        self::assertType(RaiseFileSystem::diskTotalSpace('/'), 'double');
        self::assertTrue((RaiseFileSystem::diskFreeSpace('/') / RaiseFileSystem::diskTotalSpace('/')) <= 1);
    }

}
